package com.afd.ozblip.activity;

import com.afd.ozblip.util.StringUtil;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class BusinessOtherInfoActivity extends BaseActivity {

	/****************** 视图变量 **************************/
	private TextView jiaotongTv;
	private TextView teseTv;
	private TextView qifenTv;
	/****************** 数据变量 **************************/
	private String otherInfo;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.business_ohter_info);
		// 启动返回功能
		toBack();
		// 寻找视图
		findViews();
		// 设置监听
		setListeners();
		// 获取参数
		getBundle();
		// 设置视图
		setViews();
	}

	/**
	 * 寻找视图
	 */
	public void findViews() {
		this.jiaotongTv = (TextView) findViewById(R.id.tv_business_ohter_info_jiaotong);
		this.teseTv = (TextView) findViewById(R.id.tv_business_ohter_info_tese);
		this.qifenTv = (TextView) findViewById(R.id.tv_business_ohter_info_qifen);
	}

	/**
	 * 设置监听
	 */
	public void setListeners() {
		View.OnClickListener moreClick = new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				switch (v.getId()) {
				case R.id.ll_more_layout_setting:
					Intent settingIntent = new Intent(
							BusinessOtherInfoActivity.this,
							SettingActivity.class);
					startActivity(settingIntent);
					break;

				default:
					break;
				}
			}
		};
	}

	/**
	 * 获取传递的参数
	 */
	private void getBundle() {
		Intent intent = getIntent();
		otherInfo = intent.getStringExtra("otherInfo");
	}

	private void setViews() {
		if (!StringUtil.isNullOrEmpty(otherInfo)) {
			String[] otherInfoArr = otherInfo.split("#");
			if (StringUtil.isNullOrEmpty(otherInfoArr[0])) {
				this.jiaotongTv.setText("暂无");
			}else{
				this.jiaotongTv.setText(otherInfoArr[0]);
			}
			if (StringUtil.isNullOrEmpty(otherInfoArr[1])) {
				this.teseTv.setText("暂无");
			}else{
				this.teseTv.setText(otherInfoArr[1]);
			}
			if (StringUtil.isNullOrEmpty(otherInfoArr[2])) {
				this.qifenTv.setText("暂无");
			}else{
				this.qifenTv.setText(otherInfoArr[2]);
			}
		}
	}
}